<template>
  <div>文章列表首页</div>
  {{ articleList }}
  <div>
    <div>
      <a-input v-model="articleId" placeholder="请输入文章id..."></a-input>
    </div>
    <a-button @click="btnClickHandler">点我查询数据</a-button>
    <div>
       查询到的文字内容是: {{ articleData }}
    </div>
  </div>
</template>

<script setup>
  // 引入
  import { getArticleList, getArticleById } from '@/api/article/article'
  // 变量定义
  const articleId = ''
  let articleData = {}
  let articleList = []
  // created() 执行
  getArticleList().then(rst => {
    articleList = rst
  })

  const btnClickHandler = () => {
    getArticleById(articleId).then(rst => {
      articleData = rst.data
    })
  }
</script>

<style scoped>

</style>
